import request from "@/libs/request";

export function getRouters(){
  return request({
    url:'sys/menu/getRouters',
    method:'get'
  })
}

/**
 * 获取所有菜单
 * @returns {*}
 */
export function getMenuList(){
  return request({
    url:'/sys/menu/getMenuList',
    method:'get'
  })
}
export function searchMenu(searchText){
  return request({
    url:'/sys/menu/searchMenu',
    method:'get',
    params:searchText
  })
}
export function saveMenu(data){
  return request({
    url:'/sys/menu',
    method:'post',
    data
  })
}

export function updateMenu(data){
  return request({
    url:'/sys/menu',
    method:'put',
    data
  })
}

export function deleteMenu(ids){
  return request({
    url:'/sys/menu',
    method:'delete',
    params:{ids:ids}
  })
}
